local skel = fk.CreateSkill {
  name = "emo__zengyu",
}

Fk:loadTranslationTable{
  ["emo__zengyu"] = "憎愈",
  [":emo__zengyu"] = "出牌阶段限一次，你可以选择一名角色，其进入濒死状态时回复一点体力（每轮限一次）。且你对该角色造成伤害+1。",

  ["#emo__zengyu"] = "憎愈:令一名角色濒死时回复1点体力",
  ["@@emo__zengyu"] = "憎愈",
}

skel:addEffect("active", {
  anim_type = "support",
  prompt = "#emo__zengyu",
  card_num = 0,
  target_num = 1,
  target_filter = function (self, player, to, selected)
    return #selected == 0 and to:getMark("@@emo__zengyu") == 0
  end,
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  can_use = function (self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  on_use = function (self, room, effect)
    room:setPlayerMark(effect.tos[1], "@@emo__zengyu", 1)
  end,
})

skel:addEffect(fk.DamageCaused, {
  --is_delay_effect = true,
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and data.to:getMark("@@emo__zengyu") > 0
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    data:changeDamage(1)
  end,
})

skel:addEffect(fk.EnterDying, {
  is_delay_effect = true,
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:getMark("@@emo__zengyu") > 0 and player:usedEffectTimes(self.name, Player.HistoryRound) == 0
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player.room:recover { num = 1, skillName = skel.name, who = player, recoverBy = player }
  end,
})

return skel
